package cn.kent.simple;

/*
 * 剑指offer17. 打印从1到最大的n位数
 */
public class PrintNumbers {
    public static void main(String[] args) {
        int[] ints = printNumbers(1);
        for (int anInt : ints) {
            // System.out.println(anInt);
        }
    }

    public static int[] printNumbers(int n) {
        int max = 1;
        for (int i = 0; i < n; i++) {
            max *= 10;
        }
        int[] res = new int[max - 1];
        for (int i = 0; i < max - 1; i++) {
            System.out.println(i);
            res[i] = i + 1;
        }
        return res;
    }
}
